<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=basePath%>/res/js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
		function	toPage(pageNo){
			$('#pageNo').val(pageNo);
			$('#frm').submit();
		}
		$(function(){
			$('#btnGo').click(function(){
				toPage($('#pageNo').val());
			});
			
			$('table thead tr').css('background-color', '#ADD8E6');
			$('table tbody tr:odd').css('background-color', '#90EE90');
		});
		
		function	doDelete(id){
			if(confirm('是否删除本记录？')){
				location = 'delete/' + id;
			}
		}
	</script>
  </head>
  
  <body>
  	<h1>商务会员管理系统</h1>
  	用户名：${USERS.name } &nbsp;&nbsp;&nbsp;&nbsp;
  	用户类型：${USERS.userType.name }&nbsp;&nbsp;&nbsp;&nbsp;
  	<a href="logout" >退出</a>
  	<hr>
  	<a href="modifyPwd">修改密码</a>&nbsp;&nbsp;&nbsp;&nbsp;
  	<c:if test="${USERS.userType.id == 1 }">
  		<a href="findPage">查看所有会员</a>  	
	</c:if>
	<hr>	
	<form action="modifyPwd" method="post">
		<h2>修改密码</h2>
		<p>原始密码：<input type="password" name="oldPwd" /></p>
		<p>新的密码：<input type="password" name="newPwd" /></p>
		<p>确认密码：<input type="password" name="valPwd" /></p>
		<input type="hidden" name="id" value="${USERS.id }" />
		<p><input type="submit" value="提交" /></p>
	</form>
		<script type="text/javascript">
		var msg = '${msg}';
		if(msg){
			alert(msg);
		}
	</script>
  </body>
</html>
